﻿<Window x:Class="Notoric.Gui.Windows.NewCompositionDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ls="clr-namespace:LukasKopenec.LocalizationSupport;assembly=LocalizationSupport"
        xmlns:rb="clr-namespace:Fluent;assembly=Fluent"
        xmlns:vme="clr-namespace:Notoric.ViewModel.Elements;assembly=ViewModel"
        Title="Edit Composition Properties" Height="500" Width="370"
        Background="#FFF0F0F0" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" xmlns:my="clr-namespace:Notoric.Gui.Windows"
        Loaded="Window_Loaded">
    <StackPanel>
        <StackPanel Orientation="Vertical" Background="White" Margin="7 7 7 0">
            <StackPanel Orientation="Horizontal">
                <GroupBox Header="Metadata" Width="200">
                    <StackPanel Orientation="Vertical">
                        <Label Content="Title"/>
                        <TextBox x:Name="PART_Title" Text="{Binding Title, Mode=TwoWay}"/>
                        <Label Content="Sub Title"/>
                        <TextBox x:Name="PART_SubTitle" Text="{Binding SubTitle, Mode=TwoWay}"/>
                        <Label Content="Composer(s)"/>
                        <StackPanel Orientation="Horizontal">
                            <ListBox x:Name="PART_Composers" Height="50" Width="160" ItemsSource="{Binding Composers, Mode=OneWay}">
                                <ListBox.ItemTemplate>
                                    <DataTemplate DataType="{x:Type vme:Person}">
                                        <TextBlock>
                                            <Run Text="{Binding LastName, Mode=OneWay}"/>
                                            <Run Text=", "/>
                                            <Run Text="{Binding FirstName, Mode=OneWay}"/>
                                        </TextBlock>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                            <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                <Button x:Name="PART_AddComposer" Width="16" Height="16" Margin="5" 
                                        Content="+" Padding="-2" ToolTip="Add Composer" Click="PART_AddComposer_Click"/>
                                <Button x:Name="PART_RemoveComposer" Width="16" Height="16" Margin="5" 
                                        Content="-" Padding="-2" ToolTip="Remove Composer" Click="PART_RemoveComposer_Click"/>
                            </StackPanel>
                        </StackPanel>
                        <Label Content="Lyricist(s)"/>
                        <StackPanel Orientation="Horizontal">
                            <ListBox x:Name="PART_Lyricists" Height="50" Width="160" ItemsSource="{Binding Lyricists, Mode=OneWay}">
                                <ListBox.ItemTemplate>
                                    <DataTemplate DataType="{x:Type vme:Person}">
                                        <TextBlock>
                                            <Run Text="{Binding LastName, Mode=OneWay}"/>
                                            <Run Text=", "/>
                                            <Run Text="{Binding FirstName, Mode=OneWay}"/>
                                        </TextBlock>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                            <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                <Button x:Name="PART_AddLyricist" Width="16" Height="16" Margin="5" 
                                        Content="+" Padding="-2" ToolTip="Add Lyricist" Click="PART_AddLyricist_Click"/>
                                <Button x:Name="PART_RemoveLyricist" Width="16" Height="16" Margin="5" 
                                        Content="-" Padding="-2" ToolTip="Remove Lyricist" Click="PART_RemoveLyricist_Click"/>
                            </StackPanel>
                        </StackPanel>
                        <Label Content="Date of Creation"/>
                        <TextBox x:Name="PART_CreationDate" Text="{Binding Date, Mode=TwoWay}"/>
                        <Label Content="Description"/>
                        <TextBox x:Name="PART_Description" Height="64" TextWrapping="Wrap" 
                                 HorizontalScrollBarVisibility="Visible" Text="{Binding Description, Mode=TwoWay}"/>
                    </StackPanel>
                </GroupBox>
                <StackPanel Orientation="Vertical">
                    <GroupBox Header="Instruments">
                        <ListBox x:Name="PART_Instruments" Background="White" SelectedIndex="10" 
                                 IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=my:NewCompositionDialog, AncestorLevel=1}, Path=IsNewComposition}">
                        <ListBoxItem x:Name="parts_BassStaff">BassStaff</ListBoxItem>
                        <ListBoxItem x:Name="parts_BrassQuartet">Brass Quartet</ListBoxItem>
                        <ListBoxItem x:Name="parts_BrassQuintet">Brass Quintet</ListBoxItem>
                        <ListBoxItem x:Name="parts_Guitar">Guitar</ListBoxItem>
                        <ListBoxItem x:Name="parts_ChoirBarbershop">Choir Barbershop</ListBoxItem>
                        <ListBoxItem x:Name="parts_ChoirReduction">Choir Reduction</ListBoxItem>
                        <ListBoxItem x:Name="parts_ChoirSATB">Choir SATB</ListBoxItem>
                        <ListBoxItem x:Name="parts_ChoirSATBPiano">Choir SATB + Piano</ListBoxItem>
                        <ListBoxItem x:Name="parts_ChoirSATBOrgan">Choir SATB + Organ</ListBoxItem>
                        <ListBoxItem x:Name="parts_Organ">Organ</ListBoxItem>
                        <ListBoxItem x:Name="parts_Piano">Piano</ListBoxItem>
                        <ListBoxItem x:Name="parts_StringQuartet">String Quartet</ListBoxItem>
                        <ListBoxItem x:Name="parts_VoiceKeyboard">Voice + Keyboard</ListBoxItem>
                    </ListBox>
                    </GroupBox>
                    <rb:Spinner x:Name="PART_MeasuresCount" Text="Measures Count" Format="0" Minimum="1" Maximum="32000" Value="{Binding MeasuresCount, Mode=OneWay}"/>
                </StackPanel>
            </StackPanel>
        </StackPanel>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 10 7 0">
            <Button x:Name="PART_OK" Content="{ls:Localize Windows.OKButton}" Width="60" IsDefault="True" Click="PART_OK_Click" />
            <Button x:Name="PART_Cancel" Content="{ls:Localize Windows.CancelButton}" Margin="6 0 0 0" Width="60" IsCancel="True" Click="PART_Cancel_Click"/>
        </StackPanel>
    </StackPanel>
</Window>
